<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <link rel="icon" href="/favicon.ico">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vite App</title>
  <script src="https://cdn.staticfile.org/vue/3.2.36/vue.global.min.js"></script>
  <script src="https://unpkg.com/vue@next"></script>

</head>
<style>
  .cl1{
    width: 100px;
    height: 100px;
    border: 1px solid #000;
  }
  .cl2{
    background-color: brown;
  }
  .cl3{
    background-color: gray;
  }
</style>

<body>
  <div id="hello-vue" class="demo">
    <button @click="changeActive()">change</button>
    <div class="cl1" :class="{'cl2':isActive,
    'cl3':isActive}"></div>
    <div class="cl2 cl1"></div>
  </div>
  <script>
  var app = {
    data(){
      return {
        isActive:true
      }
    },
    computed:{
     
    },
    methods:{
      changeActive:function(){
        this.isActive=!this.isActive
        console.log(this.isActive)
      }
    }
  }
  
  var vm =  Vue.createApp(app).mount('#hello-vue')
  

  </script>
  </body>
  </html>